package main

import "fmt"

func printArray(arr [5] int) {
	arr[0] = 100
	for i, v := range arr {
		fmt.Println(i, v)
	}
}

func printArrayPointer(arr *[5] int) {
	arr[0] = 100
	for i, v := range arr {
		fmt.Println(i, v)
	}
}

func main() {
	var arr1 [5] int
	arr2 := [3]int{1, 3, 5}
	arr3 := [...]int{2, 4, 6, 8, 10}
	var grad [4][5]int
	fmt.Println(arr1, arr2, arr3)
	fmt.Println(grad)
	for i := 0; i < len(arr3); i++ {
		fmt.Println(arr3[i])
	}

	for i := range arr3 {
		fmt.Println(arr3[i])
	}

	for i, v := range arr3 {
		fmt.Printf("i = %d v = %d \n",i,v)
	}

	for _, v := range arr3 {
		fmt.Println(v)
	}

	fmt.Println("printArray(arr1)")
	printArray(arr1)
	fmt.Println("printArray(arr1)")
	//printArray(arr2)
	fmt.Println("printArray(arr3)")

	printArray(arr3)
	fmt.Println("printArray(arr3)")

	printArrayPointer(&arr1)
	printArrayPointer(&arr3)
	fmt.Println("printArray(arr1) and printArray(arr3)")
	fmt.Println(arr1, arr3)
	fmt.Println("printArray(arr1) and printArray(arr3)")

}
